package org.judo.generate;

import java.io.File;

import org.judo.util.FileUtil;

public class CodeInjector
{
	public static void injectCode(String fileName,String code,String pattern) throws Exception
	{
		String existingCode = FileUtil.readFile(new File(fileName));
		existingCode = existingCode.replace(pattern,code);
		FileUtil.writeFile(new File(fileName),existingCode);
		System.out.println(fileName+" updated");
	}
}
